/**
 *
 * Copyright 2009 garrett
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
 * this file except in compliance with the License.  You may obtain a copy of the
 * License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
 * language governing permissions and limitations under the License. 
 */
package org.memesis.pandorasbook.junit;

import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;

import org.memesis.pandorasbook.PandoraApplet;
import org.memesis.pandorasbook.PandoraAppletFrame;
import org.memesis.pandorasbook.PandoraDesktop;

/**
 * A mock applet for use with JUnit tests.  No functionality aside from a property store.
 *
 * @author garrett
 */
public class MockApplet implements PandoraApplet {
	private Map<String, String> props;
	@SuppressWarnings("unused")
	private PandoraDesktop desktop;
	
	public MockApplet() {
		props = new HashMap<String, String>();
		desktop = null;
	}
	
	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#getProperties()
	 */
	@Override
	public Map<String, String> getProperties() {
		return props;
	}

	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#getProperty(java.lang.String)
	 */
	@Override
	public String getProperty(String key) {
		return props.get(key);
	}

	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#runApplet(java.lang.String)
	 */
	@Override
	public PandoraApplet runApplet(String url) throws MalformedURLException {
		// TODO Auto-generated method stub
		return null;		
	}

	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#runApplet(java.lang.String, java.util.Map)
	 */
	@Override
	public PandoraApplet runApplet(String url, Map<String, String> newProps)
			throws MalformedURLException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#setDesktop(org.memesis.pandorasbook.PandoraDesktop)
	 */
	@Override
	public void setDesktop(PandoraDesktop desk) {
		this.desktop = desk;
	}

	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#startApplet(org.memesis.pandorasbook.PandoraAppletFrame)
	 */
	@Override
	public void startApplet(PandoraAppletFrame frame) {
		return;
	}

	/* (non-Javadoc)
	 * @see org.memesis.pandorasbook.PandoraApplet#stopApplet()
	 */
	@Override
	public void stopApplet() {
		return;
	}
}
